{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}

<div class="pull-right">
    {{#link-to 'udfs.new' class="btn btn-sm btn-success"}}{{fa-icon "plus"}} NEW UDF{{/link-to}}
</div>



<div class="row jobs-table">
  <div class="col-md-12">

    {{#if sortedUDF.length}}
      <table class="table table-striped">
        <thead>
        <tr>
        <th width="20%">UDF Name
          <span class="sort-icon">
            {{#if name.noSort}}<i class="fa fa-chevron-right" {{action "sort" "name:asc" "name" "desc"}}></i>{{/if}}
            {{#if name.desc}}<i class="fa fa-chevron-down" {{action "sort" "name:desc" "name" "asc"}}></i>{{/if}}
            {{#if name.asc}}<i class="fa fa-chevron-up" {{action "sort" "" "name" "noSort"}}></i>{{/if}}
          </span>
        </th>
        <th width="20%">UDF Class Name
          <span class="sort-icon">
            {{#if classname.noSort}}<i class="fa fa-chevron-right" {{action "sort" "classname:asc" "classname" "desc"}}></i>{{/if}}
            {{#if classname.desc}}<i class="fa fa-chevron-down" {{action "sort" "classname:desc" "classname" "asc"}}></i>{{/if}}
            {{#if classname.asc}}<i class="fa fa-chevron-up" {{action "sort" "" "classname" "noSort"}}></i>{{/if}}
          </span>
        </th>
        <th width="40%">Owner
          <span class="sort-icon">
            {{#if owner.noSort}}<i class="fa fa-chevron-right" {{action "sort" "owner:asc" "owner" "desc"}}></i>{{/if}}
            {{#if owner.desc}}<i class="fa fa-chevron-down" {{action "sort" "owner:desc" "owner" "asc"}}></i>{{/if}}
            {{#if owner.asc}}<i class="fa fa-chevron-up" {{action "sort" "" "owner" "noSort"}}></i>{{/if}}
          </span>
        </th>
        <th width="20%" class="center">Action</th>
      </tr>
      </thead>
      <tbody>
        {{#each sortedUDF as |udf| }}
          {{udf-item
          udf=udf
          fileResourceList=fileResourceList
          refreshUdfList='refreshUdfList'
          }}
        {{/each}}
        </tbody>
      </table>
    {{/if}}

    {{#unless sortedUDF.length}}
      <div class="no-results">
        <div>There is No UDF.</div>
      </div>
    {{/unless}}

  </div>
</div>


{{outlet}}
